package com.syedu.day08.homework;

import java.time.LocalDate;

/**
 * @Description 员工父类
 * @createTime 2022/3/17 16:58
 * @author Administrator
 */
public abstract class Employee {
    //员工的姓名
    private String name;
    //员工的生日
    private LocalDate birthday;

    public Employee() {
    }

    public Employee(String name, LocalDate birthday) {
        this.name = name;
        this.birthday = birthday;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public LocalDate getBirthday() {
        return birthday;
    }

    public void setBirthday(LocalDate birthday) {
        this.birthday = birthday;
    }

    /**
     * 根据参数月份来确定工资，
     * 如果该月员工过生日，则公司会额外奖励100元。
     */
    public double getSalary(int month) {
        double money = 0.0;
        if (birthday.getMonthValue() == month) {
            money += 100;
        }
        return money;
    }
}
